<?php

namespace App\Http\Controllers\Api\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Facades\Services\UserService;

class LoginController extends Controller
{
    public function login(Request $request){
    	$rules = [
    		'username' => 'required',
    		'password' => 'required',
    		'remember' => 'required'
    	];

    	$this->validate($request,$rules);

    	UserService::toLogin($request->only(['username','password']),$request->remember);

    	return formatJsonResponse();
    }
}
